<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Clipboard</title>
<style type="text/css">
body { font-family:Arial; font-size:12px; }
.link:link, .link:visited { color:#0033CC; text-decoration:none; height:20px; line-height:20px; }
</style>
</head>
<body bgcolor="#f5f5f5">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td id="clipboard_copy_code"></td>
    <td>&nbsp;|&nbsp;</td>
    <td><a class="link" href="">open</a></td>
  </tr>
</table>
<script type="text/javascript">
function getClipboard(text,label,style,callback,width,height) {
	text = encodeURIComponent(text);
	label = encodeURIComponent(label);
	style = encodeURIComponent(style);
	callback = encodeURIComponent(callback);
	var clipboardSWF = "clipboard.swf?label="+label+"&style="+style+"&clipboard="+text+"&callback="+callback;
	var htm = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+width+'" height="'+height+'" align="absmiddle" id="flash_clipboard">';
  	htm += '<param name="movie" value="'+clipboardSWF+'" />';
	htm += '<param name="quality" value="high" />';
	htm += '<param name="wmode" value="Transparent"/>';
  	htm += '<param name="allowScriptAccess" value="always" />';
  	htm += '<embed src="'+clipboardSWF+'" quality="high" wmode="Transparent" allowscriptaccess="always" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" align="absmiddle" name="flash_clipboard"></embed>';
	htm += '</object>';
	return htm;
}

var text = "copy text test: " + Math.random();
document.write('<textarea cols="80" rows="10">'+text+'</textarea>');
var style = "a{font-family:Arial;color:#0033CC;font-size:12px;text-decoration:none;}a:hover{text-decoration:none;}";
var clipboard = getClipboard(text,"copy code",style,"alert('Copied!');",65,18);

document.getElementById("clipboard_copy_code").innerHTML = clipboard;

</script>


</body>
</html>
